package com.example.novel.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


public class Book implements Serializable {
    private Integer id;
    private String novelName;
    private Integer collectNumber;
    private String url;
    private String author;

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", novelName='" + novelName + '\'' +
                ", collectNumber=" + collectNumber +
                ", url='" + url + '\'' +
                ", author='" + author + '\'' +
                ", updateTime=" + updateTime +
                '}';
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm"
    )
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNovelName() {
        return novelName;
    }

    public void setNovelName(String novelName) {
        this.novelName = novelName;
    }

    public Integer getCollectNumber() {
        return collectNumber;
    }

    public void setCollectNumber(Integer collectNumber) {
        this.collectNumber = collectNumber;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

}
